<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="Pt-br">
    <head>
        <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
        <script type="text/javascript">
            _uacct = "UA-3686417-1";
            urchinTracker();
        </script>
        <script src="scripts/funcoes.js" type="text/javascript"></script>
        <?php include("metatags.php"); ?>
        <link rel="stylesheet" href="css/padrao.css" />
        <link rel="stylesheet" href="css/index.css" />
        <?php
        include("scripts/conectar.php");
        $SQLquery = "SELECT * FROM tb_enq order by id desc";
        $SQLresult = mysql_query($SQLquery,$conexao);
        $SQLrow = mysql_fetch_array($SQLresult);
        ?>
        <script src="scripts/AC_RunActiveContent.js" type="text/javascript"></script>
    </head>
    <body>
        <div id="fundo">
            <div id="principal">
                <div id="topo">
                    <script type="text/javascript">
                        AC_FL_RunContent( 'type','application/x-shockwave-flash','data','swf/banner.swf','width','745','height','197','movie','swf/banner' ); //end AC code
                    </script>
                    <noscript>
                        <object type="application/x-shockwave-flash" data="swf/banner.swf" width="745" height="197">
                            <param name="movie" value="swf/banner.swf" />
                        </object>
                    </noscript>
                </div>
                <div id="menu">
                    <script type="text/javascript">
                        AC_FL_RunContent( 'type','application/x-shockwave-flash','data','swf/menu.swf','width','745','height','35','movie','swf/menu' ); //end AC code
                    </script>
                    <noscript>
                        <object type="application/x-shockwave-flash" data="swf/menu.swf" width="745" height="35">
                            <param name="movie" value="swf/menu.swf" />
                        </object>
                    </noscript>
                </div>
                <div id="col_esq">
                    <div id="noticias" class="left">
                        <?php
                        include("scripts/conectar.php");
                        $notQuery="SELECT * FROM `tb_noticias` ORDER BY `id` DESC ";
                        $notResult=mysql_query($notQuery,$conexao);
                        $notArray=mysql_fetch_array($notResult);
                        $notId = $notArray[0];
                        $notTitulo = $notArray[2];
                        $notImagem = $notArray[4];
                        $notTexto = $notArray[5];
                        ?>
                        <div class="titulo_interno"><h1>Not&iacute;cias</h1></div>
                        <div id="noticias_imagem"><img id="not_img" src="<?php echo "$notImagem"; ?>" alt="Capa noticias" height="105"/></div>
                        <div id="noticias_texto" class="texto_interno">
                            <h1><?php echo "$notTitulo"; ?> </h1>
                            <?php echo substr($notTexto, 0, 145); ?>
                            ...<a class="leia_mais" href="noticias.php">Leia Mais</a>
                            <ul class="lista">
                                <?php
                                $sql="SELECT * FROM `tb_noticias` ORDER BY `id` DESC LIMIT 0,3";
                                $outrasNot= mysql_query($sql,$conexao);
                                while($totalNoticias= mysql_fetch_object($outrasNot)){
                                    $id = $totalNoticias -> id;
                                    $proxTitulo = $totalNoticias -> titulo;
                                    if($id != $notId){
                                        echo "<li>\n<h2><a href='noticias.php?id=$id'>$proxTitulo</a></h2>\n</li>\n ";
                                    }
                                }
                                ?>
                            </ul>
                        </div>
                    </div>
                    <div id="noticias_eventos" class="left">
                        <div class="titulo_interno"><h1>Pr&oacute;ximos Eventos </h1></div>
                        <div id="not_eventos">
                            <ul class="lista">
                                <?php
                                $eventosQuery = "SELECT * FROM tb_eventos ORDER BY data_inicio DESC";
                                $eventosResult = mysql_query($eventosQuery, $conexao);
                                for($i=1;$i<=5;$i++){
                                    $totalEventos = mysql_fetch_array($eventosResult);
                                    $id = $totalEventos[id];
                                    $tipo = $totalEventos[tipo];
                                    $titulo = $totalEventos[titulo];
                                    $exibir = $totalEventos[exibir];
                                    $data = explode('-',$totalEventos[data_inicio]);
                                    if($exibir ==1){
                                        echo "<li>\n<a href='eventos.php?id=$id' class='linkeventos'>$data[2]/$data[1]/$data[0] - $tipo: <em>&quot;$titulo&quot;</em></a>\n</li>\n ";
                                    }
                                }
                                ?>
                            </ul>
                            <a class="leia_mais" href="eventos.php">+ver eventos</a>
                        </div>
                    </div>
                    <div id="servicos" class="left">
                        <div class="titulo_interno"><h1>Servi&ccedil;os</h1></div>
                        <div id="servicos_imagem" class="imagem_interno"><img src="imagens/servicos1_min.gif" alt="Jantar" width="152" height="105"/></div>
                        <div id="servicos_texto" class="texto_interno"><h1>Parceria  ACISE, SEBRAE e Prefeitura Municipal de Esteio</h1>
                            Realizando  cursos e Palestras para capacita&ccedil;&atilde;o empresarial e da comunidade em geral ...<a class="leia_mais" href="servicos.php">Leia Mais</a>
                            <ul class="lista">
                                <li><h2><a href="servicos.php">Serasa</a></h2></li>
                                <li><h2><a href="servicos.php">Trof&eacute;u  M&eacute;rito Empresarial</a></h2></li>
                            </ul>
                        </div>
                    </div>
                    <div id="links" class="left">
                        <div class="titulo_interno"><h1>Links</h1></div>
                        <div id="links_conteudo">
                            <?php
                            $linksQuery = "SELECT * FROM tb_links order by id desc";
                            $linksResult = mysql_query($linksQuery,$conexao);

                            while($linksArray = mysql_fetch_object($linksResult)){
                                $link = $linksArray -> link;
                                $imagem = $linksArray -> imagem;
                                $desc = $linksArray -> descricao;
                                $exibir = $linksArray -> exibir;

                                if($exibir==1){
                                    echo "<div class='links_imagens'><a href='$link' target='_blank'><img src='$imagem' border='0' alt='$descricao' /></a></div>";
                                }
                            }
                            ?>
                        </div>
                    </div>
                </div>
                <div id="col_dir" class="right">
                    <div id="assoc">
                        <div id="assoc_titulo"><h3>Associe-se</h3></div>
                        <div id="assoc_texto">
                            <ul class="lista">
                                <li>Contribua voc&ecirc; tamb&eacute;m para o desenvolvimento Social e econ&ocirc;mico de Esteio.</li>
                            </ul>
                            Para associar-se <a class="leia_mais" href="associese.php">clique aqui.</a>
                        </div>
                    </div>
                    <div id="dolar">
                        <script language="javascript" src="http://www.guianews.com.br/js/gratuito/bolsas_10039.js?id=13422"></script>
                    </div>
                    <!-- <div id="enquete"> 
                        <div id="enquete_titulo"><h1>Enquete</h1></div> 
                        <div id="enquete_texto"><?php echo $SQLrow[1];?>?</div> 
                        <div id="enquete_opcoes"> 
                            <form id="form_enquete" name="form_enquete" method="post" action="scripts/enquete.php" target="enquete" onsubmit= 
                      "window.open('scripts/enquete.php','enquete','width=300,height=400,top=30,left=30,status=no')"> 
                               <?php 
                                for($i=6;$i<=9;$i++){ 
                                    $exibe=$SQLrow[$i]; 
                                    if($exibe==1){ 
                                        $j=($i-4); 
                                        $v=($i-5); 
                                        echo "<label><input type='radio' name='voto' value='$v' />$SQLrow[$j]</label><br/>"; 
                                    } 
                                } 
                                mysql_close(); 
                                ?> 
                                <br /> 
                                <input name="votar" type="submit" value="votar" class="botao"/> 
                                <input type="hidden" name="enqid" value=" <?php echo $SQLrow[0]?> "/> 
                            </form> 
                        </div> 
                     </div> -->
                    <div id="admin">
                        <div id="admin_titulo">Administrador</div>
                        <div id="admin_conteudo">
                            <form method="post" id="admin_form" name="admin_form" action="scripts/confirmar_login.php" onsubmit="return validacao()">
                                <!-- fix bug -->
                                <label for="login" class="label_admin">Usu&aacute;rio</label>
                                <!-- fix bug -->
                                <input name="login" type="text" id="admin_usuario" /><br />
                                <label for="senha" class="label_admin">Senha</label>
                                <input name="senha" type="password" id="admin_senha" />
                                <!-- fix bug -->
                                <input name="entrar" type="submit" id="entrar" class="botao" value="Entrar" />
                                <!-- fix bug  IE 6-->
                            </form><!-- fix bug IE 6-->
                            <p><?php echo $_SESSION["status"]; ?><!-- fix bug IE 6 --></p><!-- fix bug IE 6 --><!-- fix bug IE 6 --><!-- fix bug IE 6 --></div><!-- fix bug IE 6 -->
                    </div>
                </div>
            </div>  <!-- Fecha div principal -->
            <?php include("rodape.php"); ?>
        </div><!-- Fecha div fundo -->
    </body>
</html>